package com.imooc.service;

import java.util.ArrayList;
import java.util.List;

import com.imooc.beans.Message;
import com.imooc.dao.MessageDao;
import com.sun.org.apache.bcel.internal.generic.AALOAD;

public class MaintainService {
	
	public void deleteOne(String id){
		
		
		if(id !=null && !"".equals(id.trim()))	{
			MessageDao messageDao= new MessageDao();
			messageDao.deleteOne(Integer.valueOf(id));
		}
		
	}
	
public void deleteBatch(String[] ids){
		
		List<Integer> list = new ArrayList<>();
		
		for(String id:ids){
			
			list.add(Integer.valueOf(id));
			
		}
				
		MessageDao messageDao= new MessageDao();
		messageDao.deleteBatch(list);
	
		
	}
public void addMessage(Message message){
	
	
			
	MessageDao messageDao= new MessageDao();
	messageDao.addMessage(message);

	
}



}
